import sys
import libvirt

conn = libvirt.open('qemu:///system')
if conn is None:
    print('Failed to open connection to qemu:///system')
    sys.exit(1)

vcpus = conn.getMaxVcpus(None)
print('Maximum support virtual CPUs: {0}'.format(vcpus))

conn.close()

